import jsCookie from 'js-cookie';
import { MutationTree } from 'vuex'
import * as types from './mutation-types'
import { stateType } from './stateDataType'

const mutations: MutationTree<stateType> = {
  [types.SET_RIGHTLIST](state: stateType, rightList: any[]): void {
    state.rightList = rightList
    jsCookie.set('rightList', JSON.stringify(rightList))
  }
}

export default mutations